<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>amCharts examples</title>
        
		<script src="../components/jquery-ui/jquery-1.2.6.js" type="text/javascript"></script>        
        <link rel="stylesheet" href="../components/newChart/style.css" type="text/css">
        <script src="../components/newChart/amcharts/amcharts.js" type="text/javascript"></script>
        <script src="../components/newChart/amcharts/pie.js" type="text/javascript"></script>

        <script>
        
        $(function(){
        	$.ajax({
        		type:'get',
        		dataType:'json',
        		url:'statChartAction_getFactorySaleData',
        		success:function(data){
        			AmCharts.makeChart("chartdiv", {
                        "type": "pie",
                        "dataProvider":data,
                        "titleField": "factoryname",
                        "valueField": "amount",
                        "balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
                        "legend": {
                            "align": "center",
                            "markerType": "circle"
                        }
                    });
        		}
        	});
        })

            

        </script>
    </head>

    <body>
        <div id="chartdiv" style="width: 100%; height: 400px;"></div>
    </body>

</html>